package cn.demo.pm.service.impl;

import java.util.List;
import com.mybatisflex.core.paginate.Page;
import cn.demo.common.core.page.PageQuery;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import cn.demo.pm.mapper.PmSignRecordMapper;
import cn.demo.pm.domain.PmSignRecord;
import cn.demo.pm.service.IPmSignRecordService;

/**
 * 积分签到记录Service业务层处理
 *
 * @author xtjun
 * @date 2024-06-06
 */
@Service
public class PmSignRecordServiceImpl extends ServiceImpl<PmSignRecordMapper, PmSignRecord> implements IPmSignRecordService {
    @Resource
    private PmSignRecordMapper pmSignRecordMapper;
    /**
     * 查询积分签到记录
     *
     * @param id 积分签到记录主键
     * @return 积分签到记录
     */
    @Override
    public PmSignRecord selectPmSignRecordById(String id) {
        return pmSignRecordMapper.selectOneById(id);
    }

    /**
     * 查询积分签到记录列表
     *
     * @param pmSignRecord 积分签到记录
     * @return 积分签到记录
     */
    @Override
    public Page<PmSignRecord> selectPmSignRecordPage(PmSignRecord pmSignRecord, PageQuery pageQuery) {
        return pmSignRecordMapper.paginate(pageQuery.build(), QueryWrapper.create(pmSignRecord,PmSignRecord.operators));
    }
    @Override
    public List<PmSignRecord> selectPmSignRecordList(PmSignRecord pmSignRecord) {
        return pmSignRecordMapper.selectListByQuery(QueryWrapper.create(pmSignRecord,PmSignRecord.operators));
    }

    /**
     * 新增积分签到记录
     *
     * @param pmSignRecord 积分签到记录
     * @return 结果
     */
    @Override
    public int insertPmSignRecord(PmSignRecord pmSignRecord) {
        return pmSignRecordMapper.insert(pmSignRecord);
    }

    /**
     * 修改积分签到记录
     *
     * @param pmSignRecord 积分签到记录
     * @return 结果
     */
    @Override
    public int updatePmSignRecord(PmSignRecord pmSignRecord) {
        return pmSignRecordMapper.update(pmSignRecord);
    }

    /**
     * 批量删除积分签到记录
     *
     * @param ids 需要删除的积分签到记录主键
     * @return 结果
     */
    @Override
    public int deletePmSignRecordByIds(List<String> ids) {
        return pmSignRecordMapper.deleteBatchByIds(ids);
    }

    /**
     * 删除积分签到记录信息
     *
     * @param id 积分签到记录主键
     * @return 结果
     */
    @Override
    public int deletePmSignRecordById(String id) {
        return pmSignRecordMapper.deleteById(id);
    }
}
